# 3. 使用递归的方法打印出前n个斐波那契数列1,1,2,3,5,8,13....


def fib(n):
    if n == 1:
        return [1]
    elif n == 2:
        return [1, 1]
    else:
        result = []
        tmp = fib(n - 1)
        num = tmp[len(tmp)-1] + tmp[len(tmp)-2]
        result += tmp
        result.append(num)
        return result


print(fib(7))




